<template>
  <div class="common-layout">
    <el-container>
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
      <el-scrollbar>
        <el-menu :default-openeds="['1']" :unique-opened="true">
          <img src="@/assets/tubiao.png" alt="" style="width:140px;height:140px">
          <el-menu-item index="1" @click="ybp">
              <el-icon><icon-menu /><Odometer /></el-icon>仪表盘
            </el-menu-item>
          <el-sub-menu index="2">
              <template #title>
              <el-icon><icon-menu /><Menu /></el-icon>常用设置
              </template>
              <el-menu-item-group>
              <el-menu-item index="2-1" @click="jsgl">教师管理</el-menu-item>
              <el-menu-item index="2-2" @click="xsgl">学生管理</el-menu-item>
              <el-menu-item index="2-3" @click="gggl">公告管理</el-menu-item>
              <el-menu-item index="2-4" @click="xtpz">系统配置</el-menu-item>
              <el-menu-item index="2-5" @click="ptfwq">判题服务器</el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
          <el-sub-menu index="3" >
              <template #title>
              <el-icon><icon-menu /><Aim /></el-icon>问题
              </template>
              <el-menu-item-group>
              <el-menu-item index="3-1" @click="wtlb">问题列表</el-menu-item>
              <el-menu-item index="3-2" @click="zjtm">增加题目</el-menu-item>
              <el-menu-item index="3-3" @click="drdctm">导入导出题目</el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
          <el-sub-menu index="4">
              <template #title>
              <el-icon><icon-menu /><Trophy /></el-icon>比赛&练习
              </template>
              <el-menu-item-group>
              <el-menu-item index="4-1" @click="bslb">比赛列表</el-menu-item>
              <el-menu-item index="4-2" @click="cjbs">创建比赛</el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
          <el-sub-menu index="5">
              <template #title>
              <el-icon><icon-menu /><Collection /></el-icon>课程
              </template>
              <el-menu-item-group>
              <el-menu-item index="5-1" @click="kclb">课程列表</el-menu-item>
              <el-menu-item index="5-2" @click="cjkc">创建课程</el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
        </el-menu>
      </el-scrollbar>
    </el-aside>

      <el-container>
        <el-header>
          <div style="float:right;">
            <el-icon><Search /></el-icon>
            <el-icon><Share /></el-icon>
          <el-dropdown>
            <span>uesrname<el-icon><ArrowDown /></el-icon></span>
            <template #dropdown>
              <el-dropdown-menu>
                 <el-dropdown-item>logout</el-dropdown-item>
                 </el-dropdown-menu>
                 </template>
                 </el-dropdown>
          </div>
        </el-header>

        <el-main>
            <router-view></router-view>
        </el-main>

        <el-footer>
          Build Version:20210929bd
        </el-footer>
        
      </el-container>
    </el-container>
  </div>
</template>
<script>

import {Odometer,Menu,Aim,Trophy,Collection,Search,Share,ArrowDown} from '@element-plus/icons-vue'

export default{
  components:{
     Odometer,
     Menu,
     Aim,
     Trophy,
     Collection,
     Search,
     Share,
     ArrowDown

  },
  methods:{
    ybp(){
      this.$router.push('/')
    },
    jsgl(){
      this.$router.push('/jsgl')
    },
    xsgl(){
      this.$router.push('/xsgl')
    },
    gggl(){
      this.$router.push('/gggl')
    },
    xtpz(){
      this.$router.push('/xtpz')
    },
    ptfwq(){
      this.$router.push('/ptfwq')
    },
    wtlb(){
      this.$router.push('/wtlb')
    },
    zjtm(){
      this.$router.push('/zjtm')
    },
    drdctm(){
      this.$router.push('/drdctm')
    },
    bslb(){
      this.$router.push('/bslb')
    },
    cjbs(){
      this.$router.push('/cjbs')
    },
    kclb(){
      this.$router.push('/kclb')
    },
    cjkc(){
      this.$router.push('/cjkc')
    },
  }
 
}
</script>

<style>
.el-header{
  background-color: #F9FAFC;
 
  line-height: 20px;
}
.el-aside{
  background-color: #d3dce6;
  text-align: center;
  line-height: 200px;
}
.el-main{
  background-color: #EDECEC;
  text-align: center;
}
.el-footer {
  background-color: #EDECEC;
  color:var(--el-text-color-primary);
  text-align: center;
  line-height: 60px;
}
</style>